package com.example.serviceorder.feign.fallback;

import com.example.product.Product;
import com.example.serviceorder.feign.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    @Override
    public List<Product> getProductsByOrderId(Long orderId) {
        System.out.println("兜底回调....");
        Product product = new Product();
        product.setId(0L);
        product.setPrice(new BigDecimal("0"));
        product.setProductName("");
        product.setNum(0);
        return List.of(product);
    }

    @Override
    public List<Product> getProductsSecure(Long orderId, String authToken) {
        System.out.println("兜底回调....");
        Product product = new Product();
        product.setId(0L);
        product.setPrice(new BigDecimal("0"));
        product.setProductName("");
        product.setNum(0);
        return List.of(product);
    }
}
